﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace Sakura.Games.StgFramework.Builder.UI
{
	/// <summary>
	/// 应用程序的主类型。
	/// </summary>
	public partial class App : Application
	{
		/// <summary>
		/// 获取应用程序的当前实例。
		/// </summary>
		public static new App Current
		{
			get
			{
				return Application.Current as App;
			}
		}

		/// <summary>
		/// 尝试获得指定名称的资源字符串。
		/// </summary>
		/// <param name="key">资源字符串的名称。</param>
		/// <returns>资源字符串的内容。</returns>
		public string GetResourceString(object key)
		{
			return this.Resources[key] as string;
		}

		/// <summary>
		/// 获取应用程序的数据包。
		/// </summary>
		public AppData Data
		{
			get
			{
				return this.Resources["AppData"] as AppData;
			}
		}

		private void App_Startup(object sender, StartupEventArgs e)
		{
			System.Windows.Media.RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;

			this.Resources["StockIcon48"] = new Microsoft.WindowsAPICodePack.Shell.StockIcons(Microsoft.WindowsAPICodePack.Shell.StockIconSize.Large, false, false);

			this.Data.GamePackage = new GamePackage();
			this.Data.GamePackage.DamageTypes.Add(new DamageType
			{
				Name = "Test",
				Description = "Test2"
			});
		}
	}
}
